package com.aynu.likou;

/**
 * @author mj
 * @create 2021-04-06 16:34
 * @describe:
 */
public class NumberReverse {
    public static void main(String[] args) {
        System.out.println(reverse(1534236469));
    }

    public static int reverse(int num){
        if (num == 0){
            return 0;
        }
        long total = 0;
        while (true){
            total = total + (num % 10);
            num = num / 10;
            if (num == 0){
                break;
            }
            total = total * 10;
        }

        return (int) total == total ? (int)total:0;
    }
}
